package com.nbjtjc.safe.api.edu;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.nbjtjc.safe.annotation.SysLog;
import com.nbjtjc.safe.bean.Result;
import com.nbjtjc.safe.model.edu.EduRequirementSurveyItemsTemplet;
import com.nbjtjc.safe.service.edu.EduRequirementSurveyItemsTempletService;

@RestController
@CrossOrigin("*")
@RequestMapping("/eduReqItemsTemplet")
public class EduRequirementSurveyItemsTempletController{
	@Autowired
	private EduRequirementSurveyItemsTempletService eduRequirementSurveyItemsTempletService;


	  @RequestMapping(value = "/addOrUpdate",method = {RequestMethod.POST})
	  @SysLog("添加或更新需求调查模板项目")
	    public Result addList(List<EduRequirementSurveyItemsTemplet> eduRequirementSurveyItemsTemplets){
	        Result result=new Result();
	        try {
	            result=eduRequirementSurveyItemsTempletService.addList(eduRequirementSurveyItemsTemplets);
	        } catch (Exception e) {
	            e.printStackTrace();
	            result.setFalse(e.getMessage());
	        }
	        return result;
	    }

	  
	  @RequestMapping(value = "/delete",method = {RequestMethod.POST})
	  @SysLog("删除需求调查模板项目")
	    public Result delete(int id) {
	        Result result=new Result();
	        try {
	            result=eduRequirementSurveyItemsTempletService.delete(id);
	        } catch (Exception e) {
	            e.printStackTrace();
	            result.setFalse(e.getMessage());
	        }
	        return result;
	    }

	  @RequestMapping(value = "/find", method = {RequestMethod.POST})
	  public Result find(EduRequirementSurveyItemsTemplet eduRequirementSurveyItemsTemplet) {
	        Result result = new Result();
	        try {
	            result = eduRequirementSurveyItemsTempletService.find(eduRequirementSurveyItemsTemplet);
	        } catch (Exception e) {
	            e.printStackTrace();
	            result.setFalse(e.getMessage());
	        }
	        return result;
	    }
//	  @RequestMapping(value = "/findAll", method = {RequestMethod.POST})
//	  public Result findAll() {
//	        Result result = new Result();
//	        try {
//	            result = eduRequirementSurveyItemsTempletService.findAll();
//	          
//	        } catch (Exception e) {
//	            e.printStackTrace();
//	            result.setFalse(e.getMessage());
//	        }
//	        return result;
//	    }
}
